import Vue from 'vue'
import Router from 'vue-router'
//========================级管理员==============================//
//登陆
const Bosslogin = r => require.ensure([], () => r(require('cs/Boss/login/Bosslogin')), 'Bosslogin');
//后台管理
const BossContainer = r => require.ensure([], () => r(require('cs/Boss/common/BossContainer')), 'BossContainer');
//会员列表
const Member = r => require.ensure([], () => r(require('cs/Boss/Member/Member')), 'Member');
//红包列表
const Usersedlist = r => require.ensure([], () => r(require('cs/Boss/Redlist/Usersedlist')), 'Usersedlist');
//扫码列表
const Redlist = r => require.ensure([], () => r(require('cs/Boss/Redlist/Redlist')), 'Redlist');


//====================商家管理平台=============================//
//登陆
const login = r => require.ensure([], () => r(require('cs/business/login/login')), 'login');
//会员后台管理
const container = r => require.ensure([], () => r(require('cs/business/common/container')), 'container');
//红包列表
const qrcode = r => require.ensure([], () => r(require('cs/business/qrcode/qrcode')), 'qrcode');
//根据红包扫码记录
const RedRecord = r => require.ensure([], () => r(require('cs/business/qrcode/RedRecord')), 'RedRecord');
//所有扫码记录
const AllRedRecord = r => require.ensure([], () => r(require('cs/business/qrcode/AllRedRecord')), 'AllRedRecord');
/**********静态页面***************/
//支付产品
const payment = r => require.ensure([], () => r(require('cs/business/text/payment')), 'payment');
//运营工具
const Operate = r => require.ensure([], () => r(require('cs/business/text/Operate')), 'Operate');
//支付扩展工具
const Paymentextension = r => require.ensure([], () => r(require('cs/business/text/Paymentextension')), 'Paymentextension');
//资金解决方案
const capital = r => require.ensure([], () => r(require('cs/business/text/capital')), 'capital');




Vue.use(Router);
export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login,
      meta: {model: 'login'},
    },
    {
      path: '/Bosslogin',
      name: 'Bosslogin',
      component: Bosslogin,
      meta: {model: 'Bosslogin'},
    },
    {
      path: '/BossContainer',
      name: 'BossContainer',
      component: BossContainer,
      meta: {model: 'BossContainer'},
      children:[
        {
          path: '/Member',
          name: 'Member',
          component: Member,
          meta: {model: 'Member'},
        },
        {
          path: '/Usersedlist',
          name: 'Usersedlist',
          component: Usersedlist,
          meta: {model: 'Usersedlist'},
        },
        {
          path: '/Redlist',
          name: 'Redlist',
          component: Redlist,
          meta: {model: 'Redlist'},
        },
      ]
    },
    {
      path: '/container',
      name: 'container',
      component: container,
      meta: {model: 'container'},
      children: [
        {
          path: '/qrcode',
          name: 'qrcode',
          component: qrcode,
          meta: {model: 'qrcode'},
        },{
          path: '/RedRecord',
          name: 'RedRecord',
          component: RedRecord,
          meta: {model: 'RedRecord'},
        },{
          path: '/AllRedRecord',
          name: 'AllRedRecord',
          component: AllRedRecord,
          meta: {model: 'AllRedRecord'},
        },
        /*********静态页面***********/
        {
          path: '/payment',
          name: 'payment',
          component: payment,
          meta: {model: 'payment'},
        },
        {
          path: '/Operate',
          name: 'Operate',
          component: Operate,
          meta: {model: 'Operate'},
        },
        {
          path: '/Paymentextension',
          name: 'Paymentextension',
          component: Paymentextension,
          meta: {model: 'Paymentextension'},
        },
        {
          path: '/capital',
          name: 'capital',
          component: capital,
          meta: {model: 'capital'},
        },

      ]
    },
  ]
})

